package com.example.demo;


import javax.servlet.http.HttpServletRequest;

public class LogInfoBean {

    private String mdthod; //
    private String classpath; //
    private String uri; //
    private String inputData; // 提交数据
    private String reData; // 返回数据
    private String ip;
    private Long time; // 生成日志耗时
    private String heads; // 生成日志耗时


    public String getMdthod() {
        return mdthod;
    }

    public void setMdthod(String mdthod) {
        this.mdthod = mdthod;
    }


    public LogInfoBean() {
    }

    public LogInfoBean(String ip, HttpServletRequest request) {

        this.ip = ip;
        this.uri = request.getServletPath();
        this.mdthod = request.getMethod();

        this.heads = "";
        java.util.Enumeration<?> names = request.getHeaderNames();
        while (names.hasMoreElements()) {
            String name = (String) names.nextElement();
            this.heads += (name + ":" + request.getHeader(name) + ";\n");
        }
    }

    public String getHeads() {
        return heads;
    }

    public void setHeads(String heads) {
        this.heads = heads;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }



    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }



    public String getClasspath() {
        return classpath;
    }

    public void setClasspath(String classpath) {
        this.classpath = classpath;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }



    public String getInputData() {
        return inputData;
    }

    public void setInputData(String inputData) {
        this.inputData = inputData;
    }

    public String getReData() {
        return reData;
    }

    public void setReData(String reData) {
        this.reData = reData;
    }
}
